package com.macaline.controller;

import com.macaline.mapper.TestMapper;
import org.apache.log4j.Logger;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/test")
public class TestController {

    private static Logger log = Logger.getLogger(TestController.class.getSimpleName());

    @Resource
    private TestMapper testMapper;


    @Transactional
    @GetMapping("/log")
    public String log(){
        testMapper.select(11);
        testMapper.select(11);
        return "suc";
    }

}
